<?php /* Smarty version 2.6.16, created on 2012-02-08 14:45:26
         compiled from my_lesson_update.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'html_options', 'my_lesson_update.tpl', 146, false),)), $this); ?>

 <?php echo '
 <script language="javascript" src="js/contact_us.js"></script> 
<script language="javascript" type="text/javascript">
var j = jQuery.noConflict();
/*j(document).ready(function(){
	getPageId(\'';  echo $this->_tpl_vars['Formval']['game_id'];  echo '\',\'';  echo $this->_tpl_vars['Formval']['ladder_id'];  echo '\',\'';  echo $this->_tpl_vars['Formval']['race_id'];  echo '\',\'';  echo $this->_tpl_vars['Formval']['server_id'];  echo '\');
});

function getPageId(type,id,rid,sid)
{	

	j.ajax({
			type:\'POST\',
			url:\'get_game_info.php\',
			data: \'type=\'+type+\'&id=\'+id+\'&rid=\'+rid+\'&sid=\'+sid,
			dataType:\'json\',
			success:function(jData){
			
				if(jData.flag == 1)
				{
					j(\'#ladder_id_td\').html(jData.html);
					j(\'#race_id_td\').html(jData.html1);
					j(\'#server_id_td\').html(jData.html2);
				}
			},
			error: function(XMLHttpRequest, textStatus, errorThrown){
				j(".contactus-block").html("Some server error occoured. Please report to system administrator.</div>");
			}
		});
}
*/
/*function getChangeGame(id)
{	
	//alert(id);
	j(\'#ladder\').hide();
	j(\'#race\').hide();
	j(\'#region\').hide();
	j(\'#server\').hide();
	j(\'#rating\').hide();
	j.ajax({
			url:\'game_details.php\',
			data: \'id=\'+id,
			type:\'post\',		
			dataType:\'json\',	
		    success:function(resp){
		   //alert(resp.server);
		    if(resp.ladder==\'Y\')
		    {
		   		j(\'#ladder\').show();
			}			
			 if(resp.race==\'Y\')
			 {
				j(\'#race\').show();
			}	
			 if(resp.region==\'Y\')
		   	{
				j(\'#region\').show();				
			}	
			 if(resp.server==\'Y\')
		   	{
				j(\'#server\').show();
			}	
			 if(resp.rating==\'Y\')
		   	{
				j(\'#rating\').show();
			}
				}
		});
}*/

function getChangeGame(id)
{
	$.post(\'game_details.php\',{\'game_id\':id, \'action\':\'get_content\'}, function(data){
		$(\'#dynamic_controls\').html(data);
	});
}
function CheckFields()
{
  if(document.getElementById(\'student_id\').value==\'\' ) 
   {
    $(\'#FormErrorMsg\').show();
    $(\'#FormErrorMsg\').html("Please select a student");
	//$(\'#FormFieldCheckErrorMsg\').fadeOut(2000);
    return false;
   }
   if(document.getElementById(\'lesson_price\').value==\'\' ) 
   {
    $(\'#FormErrorMsg\').show();
    $(\'#FormErrorMsg\').html("Please enter price");
	//$(\'#FormFieldCheckErrorMsg\').fadeOut(2000);
    return false;
   }
   if(document.getElementById(\'lesson_title\').value==\'\' ) 
   {
    $(\'#FormErrorMsg\').show();
    $(\'#FormErrorMsg\').html("Please enter title");
	//$(\'#FormFieldCheckErrorMsg\').fadeOut(2000);
    return false;
   }
  return true;
 }  
 function keyCheck(eventObj, obj)
{
    var keyCode
 
    // Check For Browser Type
    if (document.all){
        keyCode=eventObj.keyCode
    }
    else{
        keyCode=eventObj.which
    }
 
    var str=obj.value
 
    if(keyCode==46){
        if (str.indexOf(".")>0){
            return false
        }
    }
 
    if((keyCode<46 || keyCode >57)   &&   (keyCode >31)){ // Allow only integers and decimal points
        return false
    }
    
    return true
}
</script>
'; ?>


 <div class="right-panel">
      
        <div class="findstudent-title"><a href="my_game.php"><h1 title="Games"><span>My Lessons</span></h1></a>
        <div class="breadcrumb"><?php echo $this->_tpl_vars['SubmitButton']; ?>
 Lesson</div>
        <div class="clear"></div>
		</div>
      <div class="register">
	   <div id='FormErrorMsg' style="color:red; text-align:center; padding-bottom:10px;"><?php if ($this->_tpl_vars['ermsg'] != ''): ?> <?php echo $this->_tpl_vars['ermsg'];  endif; ?> </div>
      <form name="lesson" id="lesson" action="" method="post">
	  <input type="hidden" name="lesson_id" value="<?php echo $this->_tpl_vars['Formval']['lesson_id']; ?>
" />
         <fieldset>
            <label>Select Student :</label>
            <select name="student_id" id="student_id" class="con-req">
				<option value="">Select</option>
				<?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['StudentArr'],'selected' => $this->_tpl_vars['Formval']['student_id']), $this);?>

			</select>
			<!--<label>Active :</label>
			<input name="is_active" id="is_active" type="checkbox" value="Y" <?php if ($this->_tpl_vars['Formval']['is_active'] == ''): ?> checked="checked" <?php else:  if ($this->_tpl_vars['Formval']['is_active'] == 'Y'): ?>checked<?php endif;  endif; ?>>-->
			<p class="clear"></p>
			<label>Price ($):</label>
            <input name="lesson_price" id="lesson_price" type="text" value="<?php echo $this->_tpl_vars['Formval']['lesson_price']; ?>
" onkeypress="return keyCheck(event, this);" class="con-req" />
			<p class="clear"></p>
			</span>
            <p class="clear"></p>
			<label>Title:</label>
            <input name="lesson_title" id="lesson_title" type="text" value="<?php echo $this->_tpl_vars['Formval']['lesson_title']; ?>
" class="con-req" />
			<p class="clear"></p>
            <label>Description :</label>
            <textarea  name="lesson_description" id="lesson_description"><?php echo $this->_tpl_vars['Formval']['lesson_description']; ?>
</textarea>
            <p class="clear"></p>
            <label>&nbsp;</label>
            <input name="submit" class="submit" value="<?php echo $this->_tpl_vars['SubmitButton']; ?>
" type="submit" onclick='return CheckFields()' />
            <input name="" class="cancel" value="Cancel" type="button" onclick="window.location.href='my_lesson.php'" />
         </fieldset>
      </form>
      </div>
      
      
      
      <div class="clear"></div>
   </div>